package singlenlnstace;

public class B {
private static B b;
//将类的构造器私有
    private B(){


    }

    public static B getInstance() {
        if (b == null) {
            b = new B();
        }
        return b;
    }
}
